import React from 'react';
import { Card, Table, Button, Space, Tag, Tree } from 'antd';
import { UserOutlined, LockOutlined } from '@ant-design/icons';
import './index.less';

const Permission: React.FC = () => {
  return (
    <div className="permission-container">
      <Card title="权限管理" bordered={false}>
        <div className="permission-layout">
          <div className="role-panel">
            <div className="panel-header">
              <h3>角色列表</h3>
              <Button type="primary" size="small">新增角色</Button>
            </div>
            <div className="role-list">
              <div className="role-item active">
                <UserOutlined /> 超级管理员
              </div>
              <div className="role-item">
                <UserOutlined /> 系统管理员
              </div>
              <div className="role-item">
                <UserOutlined /> 普通用户
              </div>
              <div className="role-item">
                <UserOutlined /> 访客
              </div>
            </div>
          </div>
          <div className="permission-panel">
            <div className="panel-header">
              <h3>权限配置</h3>
              <Button type="primary" size="small">保存配置</Button>
            </div>
            <div className="permission-tree">
              <Tree
                checkable
                defaultExpandAll
                defaultCheckedKeys={['system', 'system-account']}
                treeData={[
                  {
                    title: '首页',
                    key: 'home',
                  },
                  {
                    title: '统一认证',
                    key: 'auth',
                    children: [
                      {
                        title: '机构',
                        key: 'auth-organization',
                      },
                      {
                        title: '用户',
                        key: 'auth-users',
                      },
                    ],
                  },
                  {
                    title: '平台管理',
                    key: 'platform',
                    children: [
                      {
                        title: '应用集成',
                        key: 'platform-integration',
                      },
                      {
                        title: '权限管理',
                        key: 'platform-permission',
                      },
                      {
                        title: '消息',
                        key: 'platform-message',
                      },
                      {
                        title: '新闻公告',
                        key: 'platform-announcement',
                      },
                    ],
                  },
                  {
                    title: '系统管理',
                    key: 'system',
                    children: [
                      {
                        title: '账号管理',
                        key: 'system-account',
                      },
                      {
                        title: '消息管理',
                        key: 'system-notify',
                      },
                      {
                        title: '菜单管理',
                        key: 'system-menu',
                      },
                    ],
                  },
                ]}
              />
            </div>
          </div>
        </div>
      </Card>
    </div>
  );
};

export default Permission; 
